import Vue from 'vue'
import Router from 'vue-router'
// import Login from '../views/Login'
// import Home from '../views/Home'
// import Users from '../views/users/Users'
const Login = () => import(/* webpackChunkName: "login" */  '../views/Login')
const Home = () => import(/* webpackChunkName: "home" */  '../views/Home')
const Users = () => import(/* webpackChunkName: "users" */  '../views/users/Users')
const Roles = () => import(/* webpackChunkName: "roles" */  '../views/roles/Roles')
const Rights = () => import(/* webpackChunkName: "rights" */  '../views/rights/Rights')
const Goods = () => import(/* webpackChunkName: "goods" */  '../views/goods/Goods')
const AddGoods = () => import(/* webpackChunkName: "goods" */  '../views/goods/AddGoods')
const Params = () => import(/* webpackChunkName: "goods" */  '../views/goods/Params')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home/users'
    },
    {
      path: '/home',
      redirect: '/home/users'
    },{
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        {
          path: 'users',
          name: 'users',
          component: Users
        },{
          path: 'roles',
          name: 'roles',
          component: Roles
        },{
          path: 'rights',
          name: 'rights',
          component: Rights
        },{
          path: 'goods',
          name: 'goods',
          component: Goods
        },{
          path: 'addGoods',
          name: 'addGoods',
          component: AddGoods
        }, {
          path: 'params',
          name: 'params',
          component: Params
        }
      ]
    }
  ]
})
